<template>
	<view class="beijingse" v-if="pageShow">
		<u-sticky>
			<view class="flexleft"
				v-if="dataAll.goods_status==1 || dataAll.goods_status==2 || dataAll.goods_status==3 ">
				<view class="xhbox textcenter" v-if="dataAll.goods_status==1">未开始</view>
				<view class="xhbox textcenter" v-if="dataAll.goods_status==2">进行中</view>
				<view class="yjsbox textcenter" v-if="dataAll.goods_status==3">已结束</view>
				<view class="dhbox textcenter" v-if="dataAll.goods_status==1">{{dataAll.start_time_text}}开始</view>
				<view class="dhbox textcenter flexcenter" v-if="dataAll.goods_status==2">
					<view class="margin_right0">倒计时</view>
					<view class="margin_right0">
						<u-count-down :time="dataAll.end_time*1000 - Number(new Date())"
							format="HH:mm:ss"></u-count-down>
					</view>
				</view>
				<view class="yjsdhbox textcenter" v-if="dataAll.goods_status==3">倒计时：00:00:00</view>
			</view>
		</u-sticky>
		<view class="mainpadding" style="padding-bottom: 150rpx;">
			<view class="mainpadding ffffff flextop">
				<image style="width: 168rpx;height: 168rpx;" class="margin_right2" :src="dataAll.image_text" mode="">
				</image>
				<view class="flexcolumn" style="width: 72%;justify-content: space-between;align-items: flex-start;height: 168rpx;">
					<view class="ershiba xiaohei xiankuan">{{dataAll.name}}</view>
					<view class="strongtext margin_top" style="color: #555555;">当前价：
						<text class="sanshier xiaohong fonweight">￥{{dataAll.curr_price}}</text>
					</view>
				</view>
			</view>
			<view class="mainpadding ffffff margin_top">
				<view class="flexbetween">
					<view class="dingwei">
						<view class="titletext fonweight xiaohei">出价记录</view>
						<view class="zitixhx"></view>
					</view>
					<view class="flexright">
						<view class="smalltext xiaohui">已竞拍 </view>
						<view class="smalltext xiaohong">{{dataAll.outprice_num}}</view>
						<view class="smalltext xiaohui">次</view>
					</view>
				</view>
				<view class="margin_top">
					<view class="" 
						v-for="(item,index) in list.data" :key="item.id">
						<!-- <view class="yuan flexcenter" v-if="index!=0">
							<view class=""
								style="width: 10rpx;height: 10rpx;border-radius: 50%;background-color: #fff;"></view>
						</view>
						<view class="yuan flexcenter" style="background-color: #b99649;" v-if="index==0">
							<view class=""
								style="width: 10rpx;height: 10rpx;border-radius: 50%;background-color: #fff;"></view>
						</view> -->
						<view class="flexbetween margin_top1 dingwei">
							<view class="flexleft">
								<view class="yuan flexcenter margin_right1 dingwei" style="background-color: #b99649;z-index: 10;" v-if="index==0">
									<view class=""
										style="width: 10rpx;height: 10rpx;border-radius: 50%;background-color: #fff;"></view>
								</view>
								<view class="yuan flexcenter margin_right1 dingwei" style="z-index: 10;"  v-if="index!=0">
									<view class=""
										style="width: 10rpx;height: 10rpx;border-radius: 50%;background-color: #fff;"></view>
								</view>
								<view class="lineleft" v-if="index+1!=list.total"></view>
								<view class="strongtext xiaohei margin_right3 yhxk" style="width: 67rpx;">
									{{item.user.nickname}}
								</view>
								<view class="strongtext xiaohui margin_right3">{{item.createtime_text}} 出价</view>
								<image class="cjtp" src="../static/image/system/cg.png" v-if="index==0" mode=""></image>
								<image class="cjtp" src="../static/image/system/cj.png" v-else mode=""></image>
							</view>
							<view class="ershil xiaohong fonweight" v-if="index==0">￥{{item.price}}</view>
							<view class="ershil xiaohui fonweight" v-else>￥{{item.price}}</view>
						</view>
					</view>
				</view>
			</view>
			<view class="titletext fonweight xiaohei textcenter margin_top" v-if="dataAll.cjprice">您的出价金额</view>
			<view class="flexbetween margin_top mainpadding ffffff" v-if="dataAll.cjprice">
				<view class="ershil xiaohei">金额 (元)：</view>
				<view class="sanshier fonweight xiaohong">{{dataAll.cjprice}}</view>
			</view>
			<!-- 未提交支付确认订单 -->
			<template v-if="dataAll.goods_status==3&& dataAll.usergoodsprice && dataAll.usergoodsprice.status==3  && !dataAll.usergoodsprice.order_id && qrpageShow && !ddpageShow">
				<view >
					<!-- 没有存在地址 -->
					<view class="ffffff dingwei mainpadding_top flexcenter" style="height:140rpx;background-color: #fffaf0;" v-if="dataAllqrdd.addressData==null"
						@click="jumpurl('/pages_mypage/shouhuodiz?type=1')">
						<view class="margin_right2">
							<u-icon name="plus-circle-fill" color="#ba9549" size="28"></u-icon>
						</view>
						<view class="ershiba xiaohei">新增收货地址</view>
						<image style="height: 6rpx;width: 100%;position: absolute;bottom: 0;left: 0;"
							src="../static/image/system/xhx.png" mode=""></image>
					</view>
					<!-- 有地址 -->
					<view class="ffffff mainpadding_top dingwei" style="background-color: #fffaf0;" @click="jumpurl('/pages_mypage/shouhuodiz?type=1')" v-else>
						<view class="ershiba xiaohei">{{dataAllqrdd.addressData.cityinfo}}{{dataAllqrdd.addressData.address_detail}}
						</view>
						<view class="flexbetween margin_top2">
							<view class="flexleft">
								<view class="mrbtn margin_right1 textcenter" v-show="dataAllqrdd.addressData.status==1">默认</view>
								<view class="ershil xiaohui">{{dataAllqrdd.addressData.name}} {{dataAllqrdd.addressData.mobile}}</view>
							</view>
							<image style="width: 26rpx;height: 26rpx;" src="../static/image/system/bj.png" mode=""></image>
						</view>
						<image style="height: 6rpx;width: 100%;position: absolute;bottom: 0;left: 0;"
							src="../static/image/system/xhx.png" mode=""></image>
					</view>
					<view class="mainpadding ffffff">
						<view class="flextop xiahuaxian">
							<image style="width: 168rpx;height: 168rpx;" :src="dataAllqrdd.goodsinfo.image_text" mode=""></image>
							<view class="flexcolumn" style="width: 71%;justify-content: space-between;align-items: flex-start;height: 168rpx;">
								<view class="ershiba xiaohei yhxk">{{dataAllqrdd.goodsinfo.name}}</view>
								<view class="ershiba xiaohei margin_top6 fonweight">￥{{dataAllqrdd.goodsinfo.curr_price}}</view>
							</view>
						</view>
						<view class="flexbetween margin_top">
							<view class="ershil xiaohei">您的出价</view>
							<view class="ershil xiaohong fonweight">￥{{dataAllqrdd.goodsinfo.curr_price}}</view>
						</view>
						<view class="flexbetween margin_top">
							<view class="ershil xiaohei">支付平台金额</view>
							<view class="ershil xiaohong fonweight">￥{{dataAllqrdd.statis.pt_price}}</view>
						</view>
						<view class="flexbetween margin_top">
							<view class="ershil xiaohei">快递费用</view>
							<view class="ershil xiaohei">到付</view>
						</view>
						<view class="flexbetween margin_top" @click="checkIstrue(1)">
							<view class="ershil xiaohei">是否空运</view>
							<u-icon class="" v-if="is_ky==1" name="checkmark-circle-fill" color="#ba9549" size="22"></u-icon>
							<view class="weixz" v-else></view>
						</view>
						<view class="flexbetween margin_top" @click="checkIstrue(2)">
							<view class="ershil xiaohei">是否需要抛光服务（￥{{dataAllqrdd.statis.pgfw_price}}）</view>
							<u-icon class="" v-if="is_pgfw==1" name="checkmark-circle-fill" color="#ba9549" size="22"></u-icon>
							<view class="weixz" v-else></view>
						</view>
						<view class="flexbetween margin_top" @click="checkIstrue(3)">
							<view class="ershil xiaohei">是否需要翻新（￥{{dataAllqrdd.statis.fx_price}}）</view>
							<u-icon class="" v-if="is_fx==1" name="checkmark-circle-fill" color="#ba9549" size="22"></u-icon>
							<view class="weixz" v-else></view>
						</view>
						<view class="flexbetween margin_top" @click="checkIstrue(4)">
							<view class="ershil xiaohei">是否需要瑕疵处理（{{dataAllqrdd.statis.xccl_price}}）</view>
							<u-icon class="" v-if="is_xccl==1" name="checkmark-circle-fill" color="#ba9549" size="22"></u-icon>
							<view class="weixz" v-else></view>
						</view>
						<input class="input margin_top" placeholder="请输入预留微信号" type="text" v-model="wechat_code" />
					</view>
				</view>
				<view class="gudingdb ffffff mainpadding flexbetween">
					<view class="smalltext xiaohei">需支付
						<text class="titletext xiaohong fonweight">￥{{dataAllqrdd.statis.pt_totalprice}}</text>
					</view>
					<view class="dqbtn flexcenter" @click="submit()">提交订单</view>
				</view>
			</template>
			<template v-if="order_id && ddpageShow">
				<view >
					<view class="ffffff mainpadding_top dingwei" style="background-color: #fffaf0;">
						<view class="ershiba xiaohei">{{dataAllorder.addressinfo.address}}
						</view>
						<view class="ershil margin_top2 xiaohui">{{dataAllorder.addressinfo.name}} {{dataAllorder.addressinfo.mobile}}</view>
						<image style="height: 6rpx;width: 100%;position: absolute;bottom: 0;left: 0;"
							src="../static/image/system/xhx.png" mode=""></image>
					</view>
					<view class="mainpadding ffffff">
						<view class="flextop xiahuaxian">
							<image style="width: 168rpx;height: 168rpx;" :src="dataAllorder.goods_image_text" mode=""></image>
							<view class="flexcolumn" style="width: 71%;justify-content: space-between;align-items: flex-start;height: 168rpx;">
								<view class="ershiba xiaohei yhxk">{{dataAllorder.goods_name}}</view>
								<view class="ershiba xiaohei margin_top6 fonweight">￥{{dataAllorder.goods_price}}</view>
							</view>
						</view>
						<view class="flexbetween margin_top">
							<view class="ershil xiaohei">您的出价</view>
							<view class="ershil xiaohong fonweight">￥{{dataAllorder.goods_price}}</view>
						</view>
						<view class="flexbetween margin_top">
							<view class="ershil xiaohei">支付平台金额</view>
							<view class="ershil xiaohong fonweight">￥{{dataAllorder.pt_price}}</view>
						</view>
						<view class="flexbetween margin_top">
							<view class="ershil xiaohei">快递费用</view>
							<view class="ershil xiaohei">到付</view>
						</view>
						<view class="flexbetween margin_top" >
							<view class="ershil xiaohei">是否空运</view>
							<u-icon class="" v-if="dataAllorder.is_ky==1" name="checkmark-circle-fill" color="#ba9549" size="22"></u-icon>
							<view class="weixz" v-else></view>
						</view>
						<view class="flexbetween margin_top" >
							<view class="ershil xiaohei">是否需要抛光服务（￥{{dataAllorder.pgfw_price}}）</view>
							<u-icon class="" v-if="dataAllorder.is_pgfw==1" name="checkmark-circle-fill" color="#ba9549" size="22"></u-icon>
							<view class="weixz" v-else></view>
						</view>
						<view class="flexbetween margin_top" >
							<view class="ershil xiaohei">是否需要翻新（￥{{dataAllorder.fx_price}}）</view>
							<u-icon class="" v-if="dataAllorder.is_fx==1" name="checkmark-circle-fill" color="#ba9549" size="22"></u-icon>
							<view class="weixz" v-else></view>
						</view>
						<view class="flexbetween margin_top" >
							<view class="ershil xiaohei">是否需要瑕疵处理（{{dataAllorder.xccl_price}}）</view>
							<u-icon class="" v-if="dataAllorder.is_xccl==1" name="checkmark-circle-fill" color="#ba9549" size="22"></u-icon>
							<view class="weixz" v-else></view>
						</view>
						<input class="input margin_top" placeholder="请输入预留微信号" type="text" disabled="" v-model="dataAllorder.wechat_code" />
					</view>
					<!-- 支付方式 -->
					<view class="mainpadding ffffff margin_top" v-if="dataAllpay.payinfo.wechatinfo || dataAllpay.payinfo.bankinfo || dataAllpay.payinfo.aliinfo">
						<view class="sanshier xiaohei fonweight">打款方式</view>
						<view class="xiahuaxian margin_top flexbetween" v-if="dataAllpay.payinfo.wechatinfo" @click="pay_type=1">
							<view class="flextops">
								<view class="margin_right1">
									<u-icon class="" name="weixin-circle-fill" color="#50b674" size="28"></u-icon>
								</view>
								<view class="">
									<view class="ershil xiaohei">微信</view>
									<view class="flexleft margin_top2">
										<view class="smalltext margin_right0" style="color: #555555;">收款信息：</view>
										<view class="smalltext margin_right0" style="color: #555555;">
											{{dataAllpay.payinfo.wechatinfo.name}}</view>
										<view class="smalltext" style="color: #555555;">{{dataAllpay.payinfo.wechatinfo.account}}
										</view>
									</view>
								</view>
							</view>
							<u-icon class="" v-if="pay_type==1" name="checkmark-circle-fill" color="#ba9549" size="22"></u-icon>
							<view class="weixz" v-else></view>
						</view>
						<view class="xiahuaxian margin_top flexbetween" v-if="dataAllpay.payinfo.aliinfo" @click="pay_type=2">
							<view class="flextops">
								<view class="margin_right1">
									<u-icon class="" name="zhifubao-circle-fill" color="#1296DB" size="28"></u-icon>
								</view>
								<view class="">
									<view class="ershil xiaohei">支付宝</view>
									<view class="flexleft margin_top2">
										<view class="smalltext margin_right0" style="color: #555555;">收款信息：</view>
										<view class="smalltext margin_right0" style="color: #555555;">
											{{dataAllpay.payinfo.aliinfo.name}}</view>
										<view class="smalltext" style="color: #555555;">{{dataAllpay.payinfo.aliinfo.account}}
										</view>
									</view>
								</view>
							</view>
							<u-icon class="" v-if="pay_type==2" name="checkmark-circle-fill" color="#ba9549" size="22"></u-icon>
							<view class="weixz" v-else></view>
						</view>
				
						<view class="margin_top flexbetween" v-if="dataAllpay.payinfo.bankinfo" @click="pay_type=3">
							<view class="flextops">
								<view class="margin_right1">
									<image style="width: 52rpx;height: 52rpx;" src="../static/image/system/yhk.png" mode="">
									</image>
								</view>
								<view class="">
									<view class="ershil xiaohei">银行卡支付</view>
									<view class="flexleft margin_top2">
										<view class="smalltext margin_right0" style="color: #555555;">
											{{dataAllpay.payinfo.bankinfo.name}}</view>
										<view class="smalltext" style="color: #555555;">{{dataAllpay.payinfo.bankinfo.openbank}}
											{{dataAllpay.payinfo.bankinfo.account}}</view>
									</view>
								</view>
							</view>
							<u-icon class="" v-if="pay_type==3" name="checkmark-circle-fill" color="#ba9549" size="22"></u-icon>
							<view class="weixz" v-else></view>
						</view>
					</view>
					<view class="mainpadding ffffff margin_top" v-if="dataAllpay.payinfo.wechatinfo==null && dataAllpay.payinfo.bankinfo==null && dataAllpay.payinfo.aliinfo==null">
						<view class="sanshier xiaohei fonweight">打款方式</view>
						<view class="xiahuaxian margin_top flexbetween" v-if="dataAllpay.shopinfo.wechat_account" @click="pay_type=1">
							<view class="flextops">
								<view class="margin_right1">
									<u-icon class="" name="weixin-circle-fill" color="#50b674" size="28"></u-icon>
								</view>
								<view class="">
									<view class="ershil xiaohei">微信</view>
									<view class="flexleft margin_top2">
										<view class="smalltext margin_right0" style="color: #555555;">收款信息：</view>
										
										<view class="smalltext" style="color: #555555;">{{dataAllpay.shopinfo.wechat_account}}
										</view>
									</view>
								</view>
							</view>
							<u-icon class="" v-if="pay_type==1" name="checkmark-circle-fill" color="#ba9549" size="22"></u-icon>
							<view class="weixz" v-else></view>
						</view>
						<view class="xiahuaxian margin_top flexbetween" v-if="dataAllpay.shopinfo.ali_account" @click="pay_type=2">
							<view class="flextops">
								<view class="margin_right1">
									<u-icon class="" name="zhifubao-circle-fill" color="#1296DB" size="28"></u-icon>
								</view>
								<view class="">
									<view class="ershil xiaohei">支付宝</view>
									<view class="flexleft margin_top2">
										<view class="smalltext margin_right0" style="color: #555555;">收款信息：</view>
										
										<view class="smalltext" style="color: #555555;">{{dataAllpay.shopinfo.ali_account}}
										</view>
									</view>
								</view>
							</view>
							<u-icon class="" v-if="pay_type==2" name="checkmark-circle-fill" color="#ba9549" size="22"></u-icon>
							<view class="weixz" v-else></view>
						</view>
					
						<view class="margin_top flexbetween" v-if="dataAllpay.shopinfo.bankno" @click="pay_type=3">
							<view class="flextops">
								<view class="margin_right1">
									<image style="width: 52rpx;height: 52rpx;" src="../static/image/system/yhk.png" mode="">
									</image>
								</view>
								<view class="">
									<view class="ershil xiaohei">银行卡支付</view>
									<view class="flexleft margin_top2">
										<view class="smalltext margin_right0" style="color: #555555;">
											{{dataAllpay.shopinfo.bank_name}}</view>
										<view class="smalltext" style="color: #555555;">{{dataAllpay.shopinfo.openbank}}
											{{dataAllpay.shopinfo.bankno}}</view>
									</view>
								</view>
							</view>
							<u-icon class="" v-if="pay_type==3" name="checkmark-circle-fill" color="#ba9549" size="22"></u-icon>
							<view class="weixz" v-else></view>
						</view>
					</view>
				</view>
				<view class="gudingdb ffffff mainpadding flexbetween">
					<view class="smalltext xiaohei">需支付
						<text class="titletext xiaohong fonweight">￥{{dataAllorder.pay_price}}</text>
					</view>
					<view class="dqbtn flexcenter" @click="shangchuan()">上传支付凭证</view>
				</view>
			</template>
		</view>
		<view class="gudingdb ">
			<view class="mainpadding">
				<view class="xhhbtn flexcenter" style="width: 100%;"
					v-if="Number(dataAll.xb_bzj_price)==0 && dataAll.goods_status==2" @click="cjshow=true">
					<view class="titletext xiaobai fonweight">{{dataAll.cjprice?"重新出价":returntext(dataAll.add_status)}}</view>
				</view>
				<!-- 出价已结束 -->
				<view class="bighbtn"  style="background-color: #999999;color: #fff;" 
					v-if="(dataAll.goods_status==3 && !dataAll.usergoodsprice) || (dataAll.goods_status==3 && dataAll.usergoodsprice.status==2)">
					出价已结束</view>
				<!-- <view class="bigbtn"
					v-if="dataAll.goods_status==3&& dataAll.usergoodsprice && dataAll.usergoodsprice.status==3  && !dataAll.usergoodsprice.order_id"
					@click="tzqrdd">确认订单</view> -->
				<view class="bigbtn"
					v-if="dataAll.goods_status==3&& dataAll.usergoodsprice && dataAll.usergoodsprice.status==3 && dataAll.usergoodsprice.order_id"
					@click="jumpurl('/pages_mypage/wodedingd')">查看订单</view>
			</view>
			<!-- 当前活动未开始 -->
			<view class="bighbtn"  style="background-color: #999999;color: #fff;"  v-if="dataAll.goods_status==1">当前活动未开始</view>
			<!-- 活动开始出价中 -->
			<view class="flexleft" v-if="Number(dataAll.xb_bzj_price)>0 && dataAll.goods_status==2">
				<view class="xhbtn flexcenter">
					<view class="">
						<view class="titletext xiaobai fonweight textcenter">保证金￥{{dataAll.xb_bzj_price}}</view>
						<view class="strongtext xiaobai textcenter">（请提前确认网银支付限额）</view>
					</view>
				</view>
				<view class="xhhbtn flexcenter" @click="jumpdetail('/pages_homepage/baozhenjjn?price=',dataAll.xb_bzj_price)">
					<view class="titletext xiaobai fonweight">交保证金报名</view>
				</view>
			</view>
		</view>
		<u-popup :show="cjcgshow" @close="cjcgshow=false" :round="10" mode="center">
			<view class="mainpadding" style="width: 520rpx;">
				<view class="flexcenter margin_top">
					<image style="width: 186rpx;height: 197rpx;" src="../static/image/system/cjcg.png" mode=""></image>
				</view>
				<view class="sanshier fonweight xiaohei textcenter margin_top">出价成功</view>
				<view class="ershiba xiaohui textcenter margin_top">请您耐心等待相关信息</view>
				<view class="bigbtn margin_top5" @click="cjcgshow=false">知道了</view>
			</view>
		</u-popup>
		<!-- 出价未结束-->
		<u-popup :show="cjshow" @close="cjshow=false" :round="10">
			<view class="ffffff mainpadding">
				<view class="titletext fonweight xiaohei textcenter">您的出价金额</view>
				<view class="flexleft margin_top">
					<image style="min-width: 140rpx;width: 140rpx;height: 88rpx;" src="../static/image/system/jian.png"
						mode="" @click="changechujia(1)"></image>
					<view class="jjqbox flexbetween" style="width: 100%;">
						<view class="ershil xiaohei">金额 (元)：</view>
						<view class="sanshier fonweight xiaohong">{{chujia}}</view>
					</view>
					<image style="min-width: 140rpx;width: 140rpx;height: 88rpx;" src="../static/image/system/jia.png"
						mode="" @click="changechujia(2)"></image>
				</view>
				<view class="bigbtn margin_top4" @click="chujiaApi()">立即出价</view>
			</view>
		</u-popup>
		
	</view>
</template>

<script>
	const httpRequest = require("@/common/httpRequest.js")
	export default {
		data() {
			return {
				bshow: false, //出价弹框
				listid: "",
				jpid:"",
				dataAll: {},
				dataAlljp:{},
				cj_list: [],
				userInfo: {},
				cjshow: false,
				chujia: "",
				chujiat: "",
				cjcgshow: false,
				page: 1,
				limit: 12,
				list: {
					data: []
				},
				pageShow:false,
				qrpageShow:false,
				ddpageShow:false,
				goods_id: "",
				address_id: "",
				is_ky: 1,
				is_pgfw: 1,
				is_fx: 1,
				is_xccl: 1,
				dataAllqrdd: {},
				// 支付方式:1=微信,2=支付宝,3=银行卡
				pay_type: 1,
				wechat_code: "",
				order_id:"",
				dataAllorder:{},
				dataAllpay:{}
			}
		},
		onLoad(options) {
			this.listid = options.id
			this.goods_id = options.id
			// this.jpid = options.jpid
			if(options.order_id){
				this.order_id = options.order_id
				this.getOrderdetail()
			}
			this.init()
			uni.$on("checkAddressId", data => {
				this.address_id = data
			})
		},
		onUnload() {
			uni.$off("checkAddressId")
		},
		onShow() {
			this.getdetail()
			// this.getjpdetail()
			this.getinfo()
		},
		watch: {
			is_ky(newval) {
				this.initqrdd()
			},
			is_pgfw(newval) {
				this.initqrdd()
			},
			is_fx(newval) {
				this.initqrdd()
			},
			is_xccl(newval) {
				this.initqrdd()
			},
		},
		methods: {
			returntext(val){
				if(val==1){
					return "我要出价竞拍"
				}else{
					return "我要加价竞拍"
				}
			},
			checkIstrue(val){
				let that = this
				if(val==1) that.is_ky = that.is_ky==1?0:1
				if(val==2) that.is_pgfw = that.is_pgfw==1?0:1
				if(val==3) that.is_fx = that.is_fx==1?0:1
				if(val==4) that.is_xccl = that.is_xccl==1?0:1
			},
			initqrdd() {
				uni.showLoading({
					mask:true,
					title:"请稍后"
				})
				httpRequest.request('/api/ordercl/getOrderGoodsList', 'POST', {
					address_id: this.address_id,
					goods_id: this.goods_id,
					is_ky: this.is_ky,
					is_pgfw: this.is_pgfw,
					is_fx: this.is_fx,
					is_xccl: this.is_xccl,
				}).then(res => {
					uni.hideLoading()
					this.dataAllqrdd = res.data
					if (res.data.addressData) {
						this.address_id = res.data.addressData.id
					}
					if (res.data.payinfo.bankinfo) {
						this.pay_type = 3
					}
					if (res.data.payinfo.aliinfo) {
						this.pay_type = 2
					}
					if (res.data.payinfo.wechatinfo) {
						this.pay_type = 1
					}
					this.qrpageShow = true
				})
			},
			submit() {
				if (this.address_id == "") {
					httpRequest.toast("请选择收货地址")
					return false
				}
				if (this.wechat_code == "") {
					httpRequest.toast("请输入您的微信号")
					return false
				}
				uni.showLoading({
					mask: true,
					title: "请稍后"
				})
				httpRequest.request('/api/ordercl/addOrder', 'POST', {
					address_id: this.address_id,
					goods_id: this.goods_id,
					is_ky: this.is_ky,
					is_pgfw: this.is_pgfw,
					is_fx: this.is_fx,
					is_xccl: this.is_xccl,
					wechat_code: this.wechat_code,
					// pay_type: this.pay_type,
				}).then(res => {
					if (res.code == 1) {
						this.order_id = res.data.order_id
						this.pay(res.data.order_id)
					}else{
						uni.hideLoading()
						httpRequest.toast(res.msg)
					}
				})
			},
			shangchuan(){
				uni.redirectTo({
					url:'/pages_paimai/shangczfpz?id='+this.order_id+"&pay_type="+this.pay_type
				})
			},
			pay(order_id){
				let that = this
				httpRequest.request('/api/ordercl/payment', 'POST', {
					order_id
				}).then(res => {
					let data = res.data.wxconfig
					uni.hideLoading()
					if (res.code == 1) {
						uni.requestPayment({
							provider: 'wxpay',
							timeStamp: data.timeStamp,
							nonceStr: data.nonceStr,
							package: data.package,
							signType: data.signType,
							paySign: data.paySign,
							success: function(res) {
								// 支付成功
								that.getOrderdetail()
							},
							fail: function(err) {
								// 取消支付
								uni.navigateBack(1)
							}
						});
					}else{
						httpRequest.toast(res.msg)
					}
				})
			},
			// 上传支付凭证
			tzsczfpz() {
				uni.navigateTo({
					url: '/pages_paimai/shangczfpz'
				})
			},
			changechujia(val) {
				if (val == 1) {
					if (Number(this.chujiat) == Number(this.chujia)) {
						httpRequest.toast("已经最低了")
						return false
					}
					this.chujia = Number(this.chujia) - Number(this.dataAll.jj_price)
				} else {
					this.chujia = Number(this.chujia) + Number(this.dataAll.jj_price)
				}
			},
			chujiaApi() {
				httpRequest.request('/api/goodscl/goodsPriceOut', 'GET', {
					id: this.listid,
					price: this.chujia
				}).then(res => {
					if (res.code == 1) {
						this.cjshow = false
						this.cjcgshow = true
						this.getdetail()
						this.init()
					} else {
						httpRequest.toast(res.msg)
					}
				})
			},
			getinfo() {
				httpRequest.request('/api/user/index', 'GET', {}).then(res => {
					if (res.code == 1) {
						this.userInfo = res.data
					} else {
						this.userInfo = null
					}
				})
			},
			getjpdetail(){
				httpRequest.request('/api/user/myGoodsPriceDetail', 'GET', {
					id: this.jpid
				}).then(res => {
					this.dataAlljp = res.data
				})
			},
			getOrderdetail(){
				uni.showLoading({
					mask:true,
					title:"请稍后"
				})
				httpRequest.request('/api/ordercl/orderDetail', 'GET', {
					id: this.order_id
				}).then(res => {
					uni.hideLoading()
					this.dataAllorder = res.data
					this.ddpageShow = true
				})
				httpRequest.request('/api/ordercl/getPayInfo', 'GET', {
					id: this.order_id
				}).then(res => {
					uni.hideLoading()
					this.dataAllpay = res.data
				})
			},
			getdetail() {
				httpRequest.request('/api/goodscl/goodsDetail', 'GET', {
					id: this.listid
				}).then(res => {
					let dataAll = res.data
					if(dataAll.goods_status==3&& dataAll.usergoodsprice && dataAll.usergoodsprice.status==3  && !dataAll.usergoodsprice.order_id){
						this.initqrdd()
					}
					this.dataAll = res.data
					this.chujia = Number(this.dataAll.curr_price) + Number(this.dataAll.jj_price)
					this.chujiat = Number(this.dataAll.curr_price) + Number(this.dataAll.jj_price)
					this.pageShow = true
				})
			},
			init(isPage, page) {
				let _this = this
				httpRequest.request('/api/goodscl/goodsPriceIndex', 'GET', {
					page: page || 1,
					limit: 300,
					id: this.listid
				}).then(res => {
					uni.stopPullDownRefresh()
					if (res.code == 1) {
						let resList = res.data;
						let dataList = _this.list;
						if (isPage == true) {
							_this.list.data = dataList.data.concat(resList.data);
						} else {
							this.list = res.data
							_this.list.data = resList.data;
						}
					}
				}).catch(err => {
					httpRequest.toast(err.msg);
				})
			},
			onReachBottom() {
				let _this = this;
				let list = _this.list;
				let page = _this.page;
				if (list.last_page <= page) {
					return false;
				}
				page++;
				_this.page = page;
				_this.init(true, page);
			},
			// 跳转确认订单
			tzqrdd() {
				uni.navigateTo({
					url: '/pages_paimai/querendd?id=' + this.listid
				})
			},
			bclose() {
				this.bshow = false
			}
		}
	}
</script>

<style lang="scss" scoped>
	.lineleft{
		position: absolute;
		left: 10rpx;
		top: 20rpx;
		width: 1rpx;
		height: 50rpx;
		background-color: #dddddd;
	}
	/deep/.u-count-down__text {
		color: #fff !important;
		font-size: 28rpx !important;
		line-height: 30rpx !important;
	}

	.noneborder {
		border: none !important;
	}

	.xhhbtn {
		height: 100rpx;
		width: 60%;
		background: #BA9549;
		border-radius: 10rpx;
		margin-bottom: 20rpx;
	}

	.xhbtn {
		height: 100rpx;
		width: 60%;
		background: #252525;
		border-radius: 10rpx;
		margin-bottom: 20rpx;
	}

	.jjqbox {
		height: 85rpx;
		width: 100%;
		box-sizing: border-box;
		padding: 0 36rpx;
		border-top: 1rpx solid #DDDDDD;
		border-bottom: 1rpx solid #DDDDDD;
	}

	.cjtp {
		width: 57rpx;
		height: 50rpx;
	}

	.yuan {
		width: 20rpx;
		height: 20rpx;
		border-radius: 50%;
		background-color: #d6d6d6;
	}

	.hzxhx {
		padding: 0 0 30rpx 30rpx;
		border-left: 2rpx dashed #d6d6d6;
	}

	.dhhbox {
		font-weight: 400;
		font-size: 28rpx;
		color: #FFFFFF;
		padding: 17rpx 0;
		background: #A3A3A3;
		width: 70%;
	}

	.dhbox {
		font-weight: 400;
		font-size: 28rpx;
		color: #FFFFFF;
		padding: 17rpx 0;
		background: #252525;
		width: 70%;
	}

	.xhjbox {
		font-weight: 700;
		font-size: 28rpx;
		color: #FFFFFF;
		padding: 17rpx 0;
		background: #767676;
		width: 30%;
	}

	.xhbox {
		font-weight: 700;
		font-size: 28rpx;
		color: #FFFFFF;
		padding: 17rpx 0;
		background: #BA9549;
		width: 30%;
	}

	.yjsbox {
		font-weight: 700;
		font-size: 28rpx;
		color: #FFFFFF;
		padding: 17rpx 0;
		background: #767676;
		width: 30%;
	}

	.yjsdhbox {
		font-weight: 400;
		font-size: 28rpx;
		color: #FFFFFF;
		padding: 17rpx 0;
		background: #a3a3a3;
		width: 70%;
	}
</style>
<style lang="scss" scoped>
	.dqbtn {
		width: 340rpx;
		height: 90rpx;
		background: #BA9549;
		font-weight: 400;
		font-size: 28rpx;
		color: #FFFFFF;
	}

	.input {
		background: #F5F5F5;
		padding: 20rpx 30rpx;
	}

	.mrbtn {
		width: 60rpx;
		height: 30rpx;
		background: #ffeceb;
		border-radius: 37rpx 37rpx 37rpx 37rpx;
		font-weight: 400;
		font-size: 18rpx;
		color: #DB2E2E;
	}
</style>